Added Retrain All feature and improved menu styling#599
Conversation
* Added RetrainAllAction with Reset/Incremental modes for bulk training data management * Reset mode rebuilds training data from scratch using recent clean runs * Incremental mode uses rolling window to replace oldest runs with newer ones * Added Min/Max runs parameters (defaults 5/20) with 1.5x lookback period * Redesigned menu with active tab highlighting (rounded corners) and gold hover * All pages now set activeTab attribute for consistent menu state Co-Authored-By: Claude <noreply@anthropic.com>
| } | ||
|
|
||
| @RequiresSiteAdmin | ||
| public static class RetrainAllAction extends MutatingApiAction<Object> |
There was a problem hiding this comment.
This action extends MutatingApiAction<Object> but manually parses request parameters. Instead, you could define a form class and use MutatingApiAction<RetrainAllForm> to get automatic parameter binding, type safety, and default values.
Manual parsing like this:
String minRunsParam = req.getParameter("minRuns");
if (minRunsParam != null && !minRunsParam.isEmpty())
{
try { minRuns = Integer.parseInt(minRunsParam); }
catch (NumberFormatException ignored) { }
}
could be replaced with:
Integer minRuns = form.getMinRuns();
There was a problem hiding this comment.
Had Claude Code do this as suggested. There is now a form class.
| public static class RetrainAllAction extends MutatingApiAction<Object> | ||
| { | ||
| @Override | ||
| public Object execute(Object o, BindException errors) |
There was a problem hiding this comment.
This method is too long. Consider refactoring. All the SQL code could be moved to the TestResultsManager class. That's the convention I normally follow.
There was a problem hiding this comment.
Okay. Had Claude Code refactor to move queries to TestResultsManager.
|
I left a few comments. We should refactor the |
* Added RetrainAllForm class for automatic parameter binding * Moved SQL operations to TestResultsManager class * Added TabNames constants for tab identifiers and attribute name * Added getTabClass() helper to reduce repetitive code in menu.jsp * Updated all JSPs to use TabNames constants Co-Authored-By: Claude <noreply@anthropic.com>
Let me know what you think of the edits I had Claude Code do. Yes, I think you could be pretty successful with having Claude Code make the other MacCoss lab modules more standard. Right now, I just want the ability to press a single button and update the training data with a new snapshot based on the heuristics I was performing manually. |
Summary
Details
Retrain All Feature
Menu Improvements
Test plan
Co-Authored-By: Claude noreply@anthropic.com